const crawler = require('../../libs/crawler'),
      { crawlerConf } = require('../../config/config');

crawler({

  url: crawlerConf.url.course,
  callback () {
    const $ = window.$,
          $item = $('.course-tab-filter li');
    
    const data = [];

    $item.each((index, item) => {
      const $el = $(item),
            $itemLk = $el.find('.course-tab-filter-item'),
            title = $itemLk.text().replace(/促/, '');
      
      if(title !== '全部') {
        const dataItem = {
          cid: index + 1,
          title: $itemLk.text().replace(/促/, '')
        };
  
        data.push(dataItem);
      }    
    }); 

    return data;
  }

})